﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%
	dim rs,sql,i,name,act,page,fleg,listid,actt,id

    		act = Request("act")
    		actt = Request("actt")
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
	listid=Request.QueryString("listid")
	if listid="" then listid=0
	if not isnumeric(listid) then listid=0
	listid=clng(listid)
	id=Request.QueryString("id")
	if id="" then id=1
	if not isnumeric(id) then id=1
	id=clng(id)
	if act="" then act=1
	if actt="" then actt=1
        if act=1 and listid<>0 then
	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "select [name] from [qingtian_phonefenn] where [id]="&listid
	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
		name=qingtian.utf8(rs("name"))
        else
                name="出错"
	end if
	Rs.close
	set rs=nothing
        end if
Set Rs = Server.CreateObject("Adodb.Recordset")


		if act=1 then

select case v
case "0"
we0="<br/>"
Randomize()
%>
<card title="热门软件"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
ziz="<div style=""background-color:#FF5226;color:#E1E100;"">"
we0="</div>"
Randomize()
%>
<title>热门软件</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

%>		


<%
		else
select case v
case "0"
we0="<br/>"
hr="-------------<br/>"
Randomize()
book="跳到第<input name='Page' format='*N' size='2' maxlength='5'/><anchor>页<go href='downli.asp?listid="&listid&"&amp;act="&act&"&amp;sid="&sidd&"&amp;run="& Int((9999) * Rnd() + 1) &"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>"
%>
<card title="热门文章"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
Randomize()
book=""&dao&"<form action=""downli.asp?listid="&listid&"&amp;act="&act&"&amp;sid="&sidd&"&run="& Int((9999) * Rnd() + 1) &""" method=""post"">跳到第<input type=""text"" name=""Page"" value="""" format=""*N"" size=""2"" maxlength=""5""/><br/><input type=""submit"" value=""页"" /></form>"&we0&""
%>
<title>热门文章</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%
End Select
%>		
<%
		end if

		if act=1 then
                phonenid=qingtian.phonename(midqd,1)
		if sid="Null" then
%>
                <%=ziz%><a href="login.asp?sid=<%=sidd%>&amp;url=fileli.asp?id=<%=id%>">登陆</a>|<%=qingtian.phonetol("/downli.asp?listid="&listid&"@@id="&id)%><%=we0%>
<%
		else
		qingtian.info
%>
                <%=ziz%><a href="index.asp?sid=<%=sidd%>">首页</a>|<%=qingtian.phonetol("/downli.asp?listid="&listid&"@@id="&id)%><%=we0%>
<%
		end if
		%><%=dao%>热门.<a href="newli.asp?id=<%=id%>&amp;listid=<%=listid%>&amp;act=1&amp;sid=<%=sidd%>">新品</a>.<a href="tuijianli.asp?id=<%=id%>&amp;listid=<%=listid%>&amp;act=1&amp;sid=<%=sidd%>">推荐</a>.<a href="search.asp?sid=<%=sidd%>">搜索</a><%=we0%><%=qingtian.qingsav("5")%><%=hr%><%
		else
		if sid<>"Null" then
		qingtian.info
		end if
		%><%=dao%><a href="search_view.asp?sid=<%=sidd%>">搜索</a>.<a href="newli.asp?act=2&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">最新</a>.最热.<a href="tuijianli.asp?act=2&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">推荐</a><%=we0%><%=qingtian.qingsav("555555")%><%=hr%><%
		end if

		if act=1 then
                if listid<>0 then
                if actt=1 then
Response.Write(""&sou&"周排行|<a href='downli.asp?actt=2&amp;act=1&amp;listid="&listid&"&amp;sid="&sidd&"'>月排行</a>|<a href='downli.asp?actt=3&amp;act=1&amp;listid="&listid&"&amp;sid="&sidd&"'>总排行</a>"&we0&"")
                Sql = "select top 300 a.id,a.name,a.namet,a.downCount FROM qingtian_fileli a,qingtian_phoneurl b ,qingtian_phonefen c WHERE (b.bid="&phonenid&" or b.bid=0) and a.leiid=c.id and c.listid="&listid&" and a.id=b.aid and a.downCount>0 order by a.weekdown desc"               
                elseif actt=2 then
Response.Write(""&sou&"<a href='downli.asp?actt=1&amp;act=1&amp;listid="&listid&"&amp;sid="&sidd&"'>周排行</a>|月排行|<a href='downli.asp?actt=3&amp;act=1&amp;listid="&listid&"&amp;sid="&sidd&"'>总排行</a>"&we0&"")
                Sql = "select top 300 a.id,a.name,a.namet,a.downCount FROM qingtian_fileli a,qingtian_phoneurl b ,qingtian_phonefen c WHERE (b.bid="&phonenid&" or b.bid=0) and a.leiid=c.id and c.listid="&listid&" and a.id=b.aid and a.downCount>0 order by a.monthdown desc"
                else
Response.Write(""&sou&"<a href='downli.asp?actt=1&amp;act=1&amp;listid="&listid&"&amp;sid="&sidd&"'>周排行</a>|<a href='downli.asp?actt=2&amp;act=1&amp;listid="&listid&"&amp;sid="&sidd&"'>月排行</a>|总排行"&we0&"")
                Sql = "select top 300 a.id,a.name,a.namet,a.downCount FROM qingtian_fileli a,qingtian_phoneurl b ,qingtian_phonefen c WHERE (b.bid="&phonenid&" or b.bid=0) and a.leiid=c.id and c.listid="&listid&" and a.id=b.aid and a.downCount>0 order by a.downCount desc"
                end if
                else
		Sql = "select top 300 a.id,a.name,a.namet,a.downCount FROM qingtian_fileli a,qingtian_phoneurl b WHERE (b.bid="&phonenid&" or b.bid=0) and a.leiid="&id&" and a.id=b.aid and a.downCount>0 order by a.downCount desc"
                end if
		else
                if listid=0 then
		Sql = "select top 150 id,name,ReadCount from qingtian_viewli where  [ReadCount]>0  order by [ReadCount] desc"
                else
		Sql = "select top 150 id,name,ReadCount from qingtian_viewli where classid="&listid&" and [ReadCount]>0  order by [ReadCount] desc"
                end if
		end if


		Rs.Open Sql,conn,1,1



		if not (rs.bof and rs.eof)  then
				Rs.PageSize = 15	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage


		For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
			if act=1 then
dat=i+(page-1)*Rs.PageSize
dat1=dat mod 2
if dat1=0 then
%>			
<%=we%><%=dat%>.<a href="fileve.asp?id=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(2))%>|<%=qingtian.utf8(rs(1))%></a><a href='down.asp?id=<%=rs(0)%>&amp;sid=<%=sidd%>'>下载</a><%=we0%>
<%
else
%>
<%=sou%><%=dat%>.<a href="fileve.asp?id=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(2))%>|<%=qingtian.utf8(rs(1))%></a><a href='down.asp?id=<%=rs(0)%>&amp;sid=<%=sidd%>'>下载</a><%=we0%>
<%
End If
			else
dat=i+(page-1)*Rs.PageSize
dat1=dat mod 2
if dat1=0 then
%>			
<%=we%><%=dat%>.<a href="articview.asp?id=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(1))%></a><%=we0%>
<%
else
%>
<%=sou%><%=dat%>.<a href="articview.asp?id=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(1))%></a><%=we0%>
<%
End If			

			end if
	 	Rs.MoveNext
	  	Next

%>
<%=hr%>
<%
       
 
   		'分页
                if rs.PageCount>1 then
                    Response.Write we
                end if
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='downli.asp?actt="&actt&"&amp;id="&id&"&amp;listid="&listid&"&amp;act="&act&"&amp;page=" & Page + 1 & "&amp;sid="&sidd&"'>下页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write(" ")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='downli.asp?actt="&actt&"&amp;id="&id&"&amp;listid="&listid&"&amp;act="&act&"&amp;page=" & Page - 1 & "&amp;sid="&sidd&"'>上页</a>第"&Page&"/"&rs.PageCount&"页,"&we0&"")
    		Elseif rs.PageCount >1 then
    		    Response.Write "第"&Page&"/"&rs.PageCount&"页,"&we0
    		End If
            
    		Randomize()
    
    		If rs.PageCount > 2 Then
    		    Randomize()
                if v=0 then
     		    Response.Write("共"&rs.RecordCount&"条<input name='Page' format='*N' size='2' maxlength='5'/><anchor>GO&gt;&gt;<go href='downli.asp?actt="&actt&"&amp;id="&id&"&amp;listid="&listid&"&amp;act="&act&"&amp;run=" & Int((9999) * Rnd() + 1) & "&amp;sid="&sidd&"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>")
                else
     		    Response.Write("<form action=""downli.asp?actt="&actt&"&amp;id="&id&"&amp;listid="&listid&"&amp;act="&act&"&amp;run=" & Int((9999) * Rnd() + 1) & "&amp;sid="&sidd&""" method=""post"">共"&rs.RecordCount&"条<input type=""text"" name=""Page"" value="""" format=""*N"" size=""2"" maxlength=""5""/><input type=""submit"" value=""GO&gt;&gt;"" /></form><br/>")
                end if
    		End If
		else
		fleg=0
                    Response.Write("" & we & "还没添加任何文件！"&we0&"")
		end if
		Rs.close


	set rs=nothing
if act=1 and listid<>0 then
%>
<%=sou%>
当前栏目:<a href='fileli.asp?id=<%=listid%>&amp;sid=<%=sidd%>'><%=name%></a>-<a href="downli.asp?act=1&amp;actt=<%=actt%>&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">热门</a>
<%=we0%>
<%end if%>
<%=qingtian.qingsav("6")%>
   <%
end Function
%>
